package com.ocom.mqsimple.controller;

import com.alibaba.fastjson.JSON;
import com.ocom.common.constant.MqSimpleApiUrl;
import com.ocom.common.request.simple.AllPersonRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.mqsimple.business.allperson.AllPersonProductService;
import com.ocom.redis.util.RedisUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/8/16
 **/
@Slf4j
@RestController
public class AllPersonController {

	@Autowired
	AllPersonProductService allPersonProductService;

	@Resource
	RedisUtil redisUtil;

	@PostMapping(MqSimpleApiUrl.URL_allPerson)
	public Result allPerson(@RequestBody AllPersonRequest request){
		log.info("全部人员处理开始,【{}】",request);
		allPersonProductService.handle(JSON.toJSONString(request));
		return ResultUtil.success();
	}
}
